<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>用户管理|<{$configcache['Title']}></title>
    <link rel="stylesheet" type="text/css" href="__CSS__/content.css"  />
    <link rel="stylesheet" type="text/css" href="__CSS__/public.css"  />
    <script type="text/javascript" src="__JS__/jquery.js"></script>
    <script type="text/javascript" src="__JS__/Public.js"></script>
    <script type="text/javascript" src="__JS__/winpop.js"></script>
    <script type="text/javascript" src="__JS__/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="__JS__/layer/layer.js"></script>
    <link rel="stylesheet" type="text/css" href="__JS__/layer/skin/layer.css" />
    <style type="text/css">
        .select{padding:5px 10px;border:#ddd 1px solid;border-radius:4px;width:60%;margin:5% auto;font-size:12px}
        .select li{list-style:none;padding:10px 0 5px 100px}
        .select .select-list{border-bottom:#eee 1px dashed}
        .select dl{zoom:1;position:relative;line-height:24px;}
        .select dl:after{content:" ";display:block;clear:both;height:0;overflow:hidden}
        .select dt{width:100px;margin-bottom:5px;position:absolute;top:0;left:-100px;text-align:right;color:#666;height:24px;line-height:24px}
        .select dd{float:left;display:inline;margin:0 0 5px 5px;}
        .select a{display:inline-block;white-space:nowrap;height:24px;padding:0 10px;text-decoration:none;color:#039;border-radius:2px;}
        .select a:hover{color:#f60;background-color:#f3edc2}
        .select .selected a{color:#fff;background-color:#f60}
        .select-result dt{font-weight:bold}
        .select-no{color:#999}
        .select .select-result a{padding-right:20px;background:#f60 url("__PUBLIC__/image/close.gif") right 9px no-repeat}
        .select .select-result a:hover{background-position:right -15px}
        .tc{text-align:center; text-indent:0;font-family:"微软雅黑";font-size: 14px;color:#111;}
        .fixed_w { width:150px; }
        .fixed_w .oper { padding:0px 6px; color:#060; }
    </style>
    <script>
        function myBrowser(){
            var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
            var isOpera = userAgent.indexOf("Opera") > -1;
            if (isOpera) {
                return "Opera"
            }; //判断是否Opera浏览器
            if (userAgent.indexOf("Firefox") > -1) {
                return "FF";
                /*firefox----这段js重新封装了event对象，经验证可以在火狐下支持！----*/
                function __firefox(){
                    HTMLElement.prototype.__defineGetter__("runtimeStyle", __element_style);
                    window.constructor.prototype.__defineGetter__("event", __window_event);
                    Event.prototype.__defineGetter__("srcElement", __event_srcElement);
                }
                function __element_style(){
                    return this.style;
                }
                function __window_event(){
                    return __window_event_constructor();
                }
                function __event_srcElement(){
                    return this.target;
                }
                function __window_event_constructor(){
                    if(document.all){
                        return window.event;
                    }
                    var _caller = __window_event_constructor.caller;
                    while(_caller!=null){
                        var _argument = _caller.arguments[0];
                        if(_argument){
                            var _temp = _argument.constructor;
                            if(_temp.toString().indexOf("Event")!=-1){
                                return _argument;
                            }
                        }
                        _caller = _caller.caller;
                    }
                    return null;
                }
                if(window.addEventListener){
                    __firefox();
                }
            } //判断是否Firefox浏览器
            if (userAgent.indexOf("Chrome") > -1){
                return "Chrome";
            }
            if (userAgent.indexOf("Safari") > -1) {
                return "Safari";
            } //判断是否Safari浏览器
            if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) {
                return "IE";
            }; //判断是否IE浏览器
        }
    </script>
    <style type="text/css">
        #content .text1 {
            width: 120px;
            height: 26px;
            line-height: 26px;
            color: #555;
            font-family: "微软雅黑";
            background: url(__PUBLIC__/image/home/textbg.jpg) repeat-x left top;
            border: solid 1px #ccc;
        }
        #content .so1 {
            width: 60px;
            height: 28px;
            line-height: 28px;
            border: none;
            background: #090;
            color: #fff;
            font-family: "微软雅黑";
        }
        #content h2 .search1 {
            width: auto;
            height: 40px;
            right: 340px;
            float: right;
        }
    </style>
</head>
<body>
    <div id="content">
        <h1>首页 > 用户管理 > 用户列表</h1>
        <h2>
            <div class="h2_left">
                <a href="__ACTION__" class="whole">全部</a>
                <a href="javascript:;" class="f5" onclick="f5();">刷新</a>
                <a href="javascript:history.back();" class="Retreat">后退</a>
                <a href="javascript:history.go(1);" class="Advance">前进</a>
            </div>
        </h2>
        <div class="fen" style="width: 99%">
            <ul class="select" style="height:auto;margin-top: 20px;margin-bottom: 20px;">
              
                <li class="select-list List_more">
                    <dl id="select">
                        <dt>教师名称:</dt>
                        <form method="get" id="search" >
                            <input type="text" name="teacherName" class="text1" value="<{$teacherName}>"/>
                            <input type="submit" class="so1" value="搜 索" />
                        </form>
                    </dl>
                </li>
            </ul>

        </div>
        <table id="table" border="1" bordercolor="#CCCCCC" cellpadding="0" cellspacing="0">
            <tr>
                <th>用户名称 </th>
                <th>用户头像</th>
                <th>用户角色</th>
                <th>创建时间</th>
                <th>最后登录时间</th>
                <th>认证状态</th>
                <th>是否推荐</th>
                <th>操作</th>
            </tr>
            <volist name="list" id="vo">
                <tr>
                    <td style="text-align:center" class='tc'><{$vo.userName}></td>
                    <td style="text-align:center" class='tc'>
                        <img src="<{$vo.userHeadPicUrl}>" alt="" style="width:80px;height: 80px;">
                    </td>
                    <td style="text-align:center" class='tc'>
                        <switch name="vo.userRole">
                            <case value="1">学员</case>
                            <case value="2">讲师</case>
                            <default/>未知
                        </switch>
                    </td>
                    <td style="text-align:center" class='tc'><{$vo.createTime}></td>
                    <td style="text-align:center" class='tc'><{$vo.lastLoginTime}></td>
                    <td style="text-align:center" class='tc'>
                        <switch name="vo.checkStatus">
                            <case value="0">未认证</case>
                            <case value="1">待认证</case>
                            <case value="2">已认证</case>
                            <default/>未知
                        </switch>
                    </td>
                      <td style="text-align:center" class='tc'>
                        <switch name="vo.userSite">
                            <case value="0">未推荐</case>
                            <case value="1">已推荐</case>
                            <default/>未知
                        </switch>
                    </td>
                    <td class="tc fixed_w">
                    <!-- <a href="__APP__/College/userinfo/sid/<{$vo.sid}>" class="edit oper">详情</a> -->
                        <switch name="vo.userSite">
                            <case value="0"><a href="javascript:;" class="pass" style="color:#FF9933" sid='<{$vo.sid}>'>推荐</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:;" class="nopass" style="color:#FF9933" sid='<{$vo.sid}>'>取消</a></case>
                            <case value="1"><a href="javascript:;" class="pass" style="color:#FF9933" sid='<{$vo.sid}>'>推荐</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:;" class="nopass" style="color:#FF9933" sid='<{$vo.sid}>'>取消</a></case>
                            
                            <default/>
                        </switch>
                    </td>
                </tr>
            </volist>
        </table>
        <div id="page">
            <{$page}>
        </div>
    </div>

    <script>
        $('.pass').click(function(){
            var sid= ($(this).attr('sid'));
            $.ajax({
                type: "POST",
                url: "<{$SMART_URL}>/smart/teacher/manager/updateTeacherSite",
                data: {site:1,teacherId:sid},
                success: function(data){
                    if(data.code == 2000){
                        alert('推荐通过');
                        f5();
                    }else{
                        alert('网络异常,请稍后再试');
                    }
                }
            });
        });

        $('.nopass').click(function(){
            var sid= ($(this).attr('sid'));
                $.ajax({
                    type: "POST", 
                    url: "<{$SMART_URL}>/smart/teacher/manager/updateTeacherSite",
                    data: {site:0,teacherId:sid},
                    success: function(data){
                        if(data.code == 2000){
                            alert('取消推荐');
                            f5();
                        }else{
                            alert('网络异常,请稍后再试');
                        }
                    }
                });
        });



    </script>
</body>
</html>
